package com.ruoyi.stock2.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock2.mapper.SearchFromEsModelikeMapper;
import com.ruoyi.stock2.domain.SearchFromEsModelike;
import com.ruoyi.stock2.service.ISearchFromEsModelikeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 从es中查询与模型相似股票的整理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-08
 */
@Service
public class SearchFromEsModelikeServiceImpl implements ISearchFromEsModelikeService
{
    @Autowired
    private SearchFromEsModelikeMapper searchFromEsModelikeMapper;

    /**
     * 查询从es中查询与模型相似股票的整理
     *
     * @param id 从es中查询与模型相似股票的整理ID
     * @return 从es中查询与模型相似股票的整理
     */
    @Override
    public SearchFromEsModelike selectSearchFromEsModelikeById(Long id)
    {
        return searchFromEsModelikeMapper.selectSearchFromEsModelikeById(id);
    }

    /**
     * 查询从es中查询与模型相似股票的整理列表
     *
     * @param searchFromEsModelike 从es中查询与模型相似股票的整理
     * @return 从es中查询与模型相似股票的整理
     */
    @Override
    public List<SearchFromEsModelike> selectSearchFromEsModelikeList(SearchFromEsModelike searchFromEsModelike)
    {
        return searchFromEsModelikeMapper.selectSearchFromEsModelikeList(searchFromEsModelike);
    }

    /**
     * 新增从es中查询与模型相似股票的整理
     *
     * @param searchFromEsModelike 从es中查询与模型相似股票的整理
     * @return 结果
     */
    @Override
    public int insertSearchFromEsModelike(SearchFromEsModelike searchFromEsModelike)
    {
        return searchFromEsModelikeMapper.insertSearchFromEsModelike(searchFromEsModelike);
    }

    /**
     * 修改从es中查询与模型相似股票的整理
     *
     * @param searchFromEsModelike 从es中查询与模型相似股票的整理
     * @return 结果
     */
    @Override
    public int updateSearchFromEsModelike(SearchFromEsModelike searchFromEsModelike)
    {
        return searchFromEsModelikeMapper.updateSearchFromEsModelike(searchFromEsModelike);
    }

    /**
     * 删除从es中查询与模型相似股票的整理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSearchFromEsModelikeByIds(String ids)
    {
        return searchFromEsModelikeMapper.deleteSearchFromEsModelikeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除从es中查询与模型相似股票的整理信息
     *
     * @param id 从es中查询与模型相似股票的整理ID
     * @return 结果
     */
    @Override
    public int deleteSearchFromEsModelikeById(Long id)
    {
        return searchFromEsModelikeMapper.deleteSearchFromEsModelikeById(id);
    }

    @Override
    public int deleteSearchFromEsModelikeByDate(Date createDate) {
        return searchFromEsModelikeMapper.deleteSearchFromEsModelikeByDate(createDate);
    }
}
